package com.wuyou.designPatterns.visiotor;

import com.wuyou.designPatterns.composite.FileTreatmentException;

import java.util.Iterator;

/**
 * @Description
 * @Author 无忧
 * @Date 2024/10/11 21:15
 */
public abstract class Entry implements Element{


    public abstract String getName();

    public abstract int getSize();

    public Entry add(Entry e) throws FileTreatmentException {
        throw new FileTreatmentException();
    }

    public Iterator<Entry> iterator() throws FileTreatmentException{
        throw new FileTreatmentException();
    }

    public String toString(){
        return getName() + "(" + getSize() + ")";
    }
}
